package cn.longge.controller;

import cn.longge.entity.Result;
import cn.longge.entity.SysOffice;
import cn.longge.service.ISysOfficeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("manager/office")
public class SysOfficeController {
    @Autowired
    private ISysOfficeService sysOfficeService;

    @RequestMapping("list")
    public Result findAll(){
        Result result = new Result();
        SysOffice sysOffice = new SysOffice();
        sysOffice.setDelFlag("0");
        result.setObj(sysOfficeService.select(sysOffice));
        return result;
    }

    @RequestMapping("selectByRid")
    public Result selectByRid(Long rid){
        Map<String, List<SysOffice>> map = sysOfficeService.selectByRid(rid);
        return new Result(true,"success",map);
    }

}
